#include "Thread.h"

using namespace std;
using namespace util;

Thread::Thread(ThreadFunc func)
    : tid_( ++ counter_)
    , func_(func)
{
    static_assert(std::is_invocable_v<ThreadFunc, int>, "The provided function is not invocable!");
}

void Thread::start()
{
	thread worker(func_, tid_);
	worker.detach();
}

int util::Thread::tid()
{
    return tid_;
}
